 Encode Special Characters 



When submitting the form "GET" method, JavaScript can encode special characters with the escape() function. Great! (Enter a nickname or password with some special variables then click 'submit' to see the web address which contains the encoded (%xx) characters.)  



<!-- TWO STEPS TO INSTALL ENCODE SPECIAL CHARACTERS:

  1.  Copy the coding into the HEAD of your HTML document
  2.  Add the last code into the BODY of your HTML document  -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function processForm(form) {
var nickname = form.nickname.value;
var password = form.password.value;

nickname = escape(nickname);
password = escape(password);

window.location = window.location + "?nickname=" + nickname + "&password=" + password;
}
//  End -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document  -->

<BODY>

<center>
<form action="">
<tt><pre>
Nickname:  <input type=text name=nickname value="" size=10>
Password:  <input type=text name=password value="" size=10>

<input type=button value="Submit!" onClick="javascript:processForm(this.form);">
</pre></tt>
</form>
</center>

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size:  1.10 KB -->